package com.zyz.I_多线程.单例模式.懒汉式;

/**
 * @author: vick
 * @Date: 2025/3/22
 * @Description:
 * @version: 1.0
 */
public class Singleton2 {

    //为了不让new，产生不一样的对象，所以构造器私有化
    private Singleton2() {
    }


    public static Singleton2 getInstance() {
        return Inner.INSTANCE;
    }

    public static class Inner{
        static final Singleton2 INSTANCE = new Singleton2();
    }
}
